# import openai
# import os
# import re
# import requests
# import sys
#
# import os
#
# from openai.embeddings_utils import get_embedding, cosine_similarity
#
#
# API_KEY = "5fa76d1efe7842fbb9310f93a1b9b93f"
# RESOURCE_ENDPOINT = "https://kykgpt.openai.azure.com"
#
# openai.api_type = "azure"
# openai.api_key = API_KEY
# openai.api_base = RESOURCE_ENDPOINT
# openai.api_version = "2022-12-01"
#
# url = openai.api_base + "/openai/deployments?api-version=2022-12-01"
#
# #r = requests.get(url, headers={"api-key": API_KEY})
# # print(r.text)
#
# print('-' * 80)
#
# r1 = get_embedding('汉堡包', engine='kykembedding')
# # print(r1)
#
# r2 = get_embedding('热狗', engine='kykembedding')
# # print(r2)
# r3 = get_embedding('hotdog', engine='kykembedding')
# print('hotdog', r3)
# # r4 = get_embedding('ホットドッグ', engine='kykembedding')
# # r5 = get_embedding('Xúc xích', engine='kykembedding')
# # r6 = get_embedding('Хот - доги', engine='kykembedding')
#
# # result = cosine_similarity(r1, r2)
# # print('汉堡包与热狗的相似度', result)
# # result = cosine_similarity(r1, r3)
# # print('汉堡包与hotdog', result)
# # result = cosine_similarity(r1, r4)
# # print('汉堡包与ホットドッグ(日语热狗)', result)
# # result = cosine_similarity(r1, r5)
# # print('汉堡包与Xúc xích(越南语热狗)', result)
# # result = cosine_similarity(r1, r6)
# # print('汉堡包与Хот - доги (俄语热狗)', result)


from utils.msg_queue import connect_message_queue
from setting.redis_config import redis_embed_url

queue_name = 'tag_embed_data'
q = connect_message_queue(queue_name, url=redis_embed_url, maxsize=10000, lazy_limit=True)
data = q.get()
print(data)